<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
	/**
	 功能名称:查看、设置学年学期功能
	 @author:
	 **/
%>
<%
String path = request.getContextPath();
%>
<html>
<head>
<title>年度与学期设置</title>
<link href="<%=path %>/css/index_css.css" rel="stylesheet" type="text/css" />
<script src="<%=path%>/js/resizeIframe.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function(){
   	 
   	 resizeIframe();
     
       
     
     
     if("${requestScope.INFO}"!="")
     {
     	alert("${requestScope.INFO}");
     }
      }    
      
      //添加年度
     function goAdd(){
	  var value=window.showModalDialog("<%=path %>/baseSet/yearAndSchoolTerm/addYear.jsp",'',"dialogHeight:400px;dialogWidth:482px;help=0;scroll=1;");
	 if(value=='true'){
	  window.location.href="<%=path %>/getAllYearAndSchoolTermyearAndSchoolTermAction.action";
	 }
     }
     
      //添加学期
     function goAdd1(){
	  var value=window.showModalDialog("<%=path %>/baseSet/yearAndSchoolTerm/addSemeter.jsp",'',"dialogHeight:400px;dialogWidth:482px;help=0;scroll=1;");
	 if(value=='true'){
	  window.location.href="<%=path %>/getAllYearAndSchoolTermyearAndSchoolTermAction.action";
	 }
     }
     
     //修改年度
     function goUpdate(yearid){
	 var value=window.showModalDialog("<%=path %>/findYearByYearIdyearAndSchoolTermAction.action?year.yearId="+yearid+"&t="+new Date(),'',"dialogHeight:400px;dialogWidth:482px;help=0;scroll=1;");
	 if(value=='true'){
	  window.location.href="<%=path %>/getAllYearAndSchoolTermyearAndSchoolTermAction.action";
	 }
     }
     
     function tdClick(url){
       window.location.href=url;
     }
     
     //修改学期
     function goUpdate1(schoolTermid)
     {
	 var value=window.showModalDialog("<%=path %>/findSchoolTermBySchoolTermIdyearAndSchoolTermAction.action?schoolTerm.schoolTermId="+schoolTermid+"&t="+new Date(),'',"dialogHeight:400px;dialogWidth:482px;help=0;scroll=1;");
	 if(value=='true'){
	  window.location.href="<%=path %>/getAllYearAndSchoolTermyearAndSchoolTermAction.action";
	 }
     }
     
     //检验是否选择年度
     function checkYear(){
     var isCheck=false;
     var radioYear=document.getElementsByName("basic.value");
     for(var i=0;i<radioYear.length;i++){
	 if(radioYear[i].checked && radioYear[i].attributes["current"].nodeValue=="year"){
	     isCheck=true;
	   }
	  }
	  if(!isCheck){
	  alert("请选择要设置的信息！");
	  return;
	  }
	  document.myform1.submit();
     }
     
     //检验是否选择学期
     function checkSchoolTerm(){
     var isCheck=false;
     var radioSchoolTerm=document.getElementsByName("basic.value");
     for(var i=0;i<radioSchoolTerm.length;i++){
	 if(radioSchoolTerm[i].checked && radioSchoolTerm[i].attributes["current"].nodeValue=="schoolTerm"){
	     isCheck=true;
	   }
	  }
	  if(!isCheck){
	  alert("请选择要设置的信息！");
	  return;
	  }
	  document.myform2.submit();
     }
</script>
</head>
  <body>
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="2" align="left" class="f_5">基本设置</td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#9DD12E"></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="bottom" background="<%=path %>/images/sywesp_24.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
       
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/getGradeListGradeAndClassAction.action');" style="cursor:pointer;">年级设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
             <td width="70" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path %>/getGradeListGradeAndClassAction.action?setGraduation=true');" style="cursor:pointer;">毕业年级</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onClick="tdClick('<%=path%>/findGradeAndClassBySchoolGradeAndClassAction.action?year=${applicationScope.currentYear}');"" style="cursor:pointer;">班级设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="80" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_25.gif" class="f_9">年度学期设置</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/findCourseByParentCourseIdCourseAction.action');" style="cursor:pointer;">学科设置</td>
                <td width="5" align="right" valign="bottom" background="<%=path %>/images/sywesp_18.gif"><img src="<%=path %>/images/sywesp_19.gif" width="5" height="31" /></td>
              </tr>
            </table></td>
            <td width="80" align="left"><table width="80" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/findAllOrganizationByTypeorganizationAction.action?organization.orgType=1');" style="cursor:pointer;">教研组设置</td>
                <td width="5" align="right" valign="bottom" background="<%=path %>/images/sywesp_18.gif"><img src="<%=path %>/images/sywesp_19.gif" width="5" height="31" /></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="100" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('findAllCodeMaintenanceTypeCodeMaintenanceAction.action');" style="cursor:pointer;">选项配置</td>
                <td width="5" align="right" valign="bottom" background="<%=path %>/images/sywesp_18.gif"><img src="<%=path %>/images/sywesp_19.gif" width="5" height="31" /></td>
              </tr>
            </table></td>
             
            <td width="70" align="left"><table width="70" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="tdClick('<%=path %>/baseSet/openClose.jsp');" style="cursor:pointer;">开关控制</td>
                <td width="5" align="right" valign="bottom" background="<%=path %>/images/sywesp_18.gif"><img src="<%=path %>/images/sywesp_19.gif" width="5" height="31" /></td>
              </tr>
            </table></td>
              <td width="70" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="images/sywesp_18.gif" class="f_6" style="cursor:pointer;" nowrap="nowrap" onclick="tdClick('<%=path %>/initMethodGraduationAndUpgradeAction.action');">毕业升级</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td width="70" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" style="cursor:pointer;" nowrap="nowrap" onclick="tdClick('<%=path %>/toClassSectionTimesListClassSectionTimesAction.action');">课时管理</td>
                <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
              </tr>
            </table></td>
            <td align="left">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td align="left" valign="top" class="tb_8 border_2">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="83%" height="30" align="left" bgcolor="#DCE8F6"><span class="f_5">&nbsp;年度设置：</span></td>
            <td width="17%" align="right" bgcolor="#DCE8F6">
            
            <img src="<%=path %>/images/icon_12.gif" width="18" height="18" align="absmiddle" />
            <a href="javascript:goAdd();">添加年度</a>
            
            &nbsp;
            </td>
          </tr>
          <tr>
            <td height="30" colspan="2" align="left" valign="top">
            
            <form action="currentYearyearAndSchoolTermAction.action" method="post" id="myform1" name="myform1">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="left" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="left" valign="top">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="2" height="24" align="left" background="<%=path %>/images/sywesp_21.gif"><img src="<%=path %>/images/sywesp_20.gif" width="2" height="24" /></td>
                          <td align="left" background="<%=path %>/images/sywesp_21.gif">
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="3%">&nbsp;</td>
                                <td width="61%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />年度名称</td>
                                <td width="28%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />年度</td>
                                <td width="8%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />
                                
                                    操作
                                
                                </td>
                              </tr>
                          </table>
                          </td>
                          <td width="4" align="right" background="<%=path %>/images/sywesp_21.gif"><img src="<%=path %>/images/sywesp_22.gif" width="4" height="24" /></td>
                        </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td align="left" valign="top">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td height="25" align="left" valign="top" class="tb_7">
                          <c:if test="${! empty requestScope.AllYear}">
                          <c:forEach items="${requestScope.AllYear}" var="year">
                          <table width="100%" border="0" cellspacing="1" cellpadding="0">
                              <tr>
                                <td width="3%" align="right" valign="bottom">
                                <c:choose>
                                <c:when test="${applicationScope.currentYear eq year.yearValue}">
                                <span class="f_4"><img src="<%=path %>/images/icon_13.gif" width="16" height="14" /></span>
                                </c:when>
                                <c:otherwise>
                                &nbsp;
                                </c:otherwise>
                                </c:choose>
                                </td>
                                <td width="61%" height="25" align="left" valign="bottom" class="f_4">
                                <c:choose>
                                <c:when test="${applicationScope.currentYear eq year.yearValue}">
                                <input name="basic.value" type="radio" value="${year.yearValue }" checked="checked" current="year"/>${year.name }
                                </c:when>
                                <c:otherwise>
                                <input name="basic.value" type="radio" value="${year.yearValue }" current="year"/>${year.name }
                                </c:otherwise>
                                </c:choose>
                                </td>
                                <td width="28%" align="left" valign="bottom" class="f_4">${year.yearValue }</td>
                                <td width="8%" valign="bottom">
                                
                                <a href="javascript:goUpdate('${year.yearId }')"><img src="<%=path %>/images/icon_5.gif" width="15" height="16" border="0"/></a> &nbsp;
                                <a href="<%=path %>/deleteYearByYearIdyearAndSchoolTermAction.action?year.yearId=${year.yearId }" onclick="return window.confirm('确定删除此年度？')"><img src="<%=path %>/images/icon_11.gif" width="12" height="12" border="0"/></a>
                                
                                </td>
                              </tr> 
                          </table>
                          </c:forEach>
                          </c:if>
                          </td>
                        </tr>
                      </table>
                      </td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td height="35" align="center">
                <c:if test="${! empty requestScope.AllYear }">
                <input type="button" name="Submit2" value="提 交" onclick="checkYear();"/>
                </c:if>
                </td>
              </tr>
            </table>
            </form>
            
            </td>
            </tr>
           </table>

          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="83%" height="30" align="left" bgcolor="#DCE8F6"><span class="f_5">&nbsp;学期设置：</span></td>
              <td width="17%" align="right" bgcolor="#DCE8F6">
              
              <img src="<%=path %>/images/icon_12.gif" width="18" height="18" align="absmiddle" /> 
               <a href="javascript:goAdd1();">添加学期</a>
              
              &nbsp;
              </td>
            </tr>
            <tr>
              <td height="30" colspan="2" align="left" valign="top">
              
              <form action="currentSchoolTermyearAndSchoolTermAction.action" method="post" id="myform2" name="myform2">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="left" valign="top">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td align="left" valign="top">
                          
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="2" height="24" align="left" background="<%=path %>/images/sywesp_21.gif"><img src="<%=path %>/images/sywesp_20.gif" width="2" height="24" /></td>
                                <td align="left" background="<%=path %>/images/sywesp_21.gif">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td width="3%">&nbsp;</td>
                                      <td width="61%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />学期</td>
                                      <td width="28%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />值</td>
                                      <td width="8%" align="left" class="f_8"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />
                                      
                                           操作
                                      
                                      </td>
                                    </tr>
                                </table>
                                </td>
                                <td width="4" align="right" background="<%=path %>/images/sywesp_21.gif"><img src="<%=path %>/images/sywesp_22.gif" width="4" height="24" /></td>
                              </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td align="left" valign="top">
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td height="25" align="left" valign="top" class="tb_7">
                                <c:if test="${! empty requestScope.AllSchoolTerm}">
                                <c:forEach items="${requestScope.AllSchoolTerm}" var="schoolTerm">
                                <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                    <tr>
                                      <td width="3%" align="right" valign="bottom">
                                      <c:choose>
                                      <c:when test="${applicationScope.currentSchoolTerm eq schoolTerm.schoolTermValue}">
                                      <span class="f_4"><img src="<%=path %>/images/icon_13.gif" width="16" height="14" /></span>
                                      </c:when>
                                      <c:otherwise>
                                      &nbsp;
                                      </c:otherwise>
                                      </c:choose>
                                      </td>
                                      <td width="61%" height="25" align="left" valign="bottom" class="f_4">
                                      <c:choose>
                                      <c:when test="${applicationScope.currentSchoolTerm eq schoolTerm.schoolTermValue}">
                                      <input name="basic.value" type="radio" value="${schoolTerm.schoolTermValue }" checked="checked" current="schoolTerm"/>${schoolTerm.name }
                                      </c:when>
                                      <c:otherwise>
                                      <input name="basic.value" type="radio" value="${schoolTerm.schoolTermValue }" current="schoolTerm"/>${schoolTerm.name }
                                      </c:otherwise>
                                      </c:choose>
                                      </td>
                                      <td width="28%" align="left" valign="bottom" class="f_4">${schoolTerm.schoolTermValue }</td>
                                      <td width="8%" valign="bottom">
                                      
                                      <a href="javascript:goUpdate1('${schoolTerm.schoolTermId }')"><img src="<%=path %>/images/icon_5.gif" width="15" height="16" border="0" /></a>&nbsp;
                                      <a href="<%=path %>/deleteSchoolTermBySchoolTermIdyearAndSchoolTermAction.action?schoolTerm.schoolTermId=${schoolTerm.schoolTermId }" onclick="return window.confirm('确定删除此学期？')"><img src="<%=path %>/images/icon_11.gif" width="12" height="12" border="0" /></a>
                                      
                                      </td>
                                    </tr>
                                </table>
                                </c:forEach>
                                </c:if>
                                </td>
                              </tr>
                            </table> 
                                  </td>
                                </tr>
                              </table>
                            </td>
                        </tr>
                        <tr>
		                    <td height="35" align="center">
		                    <c:if test="${ ! empty requestScope.AllSchoolTerm }">
		                    <input type="button" name="Submit22" value="提 交" onclick="checkSchoolTerm();"/>
		                    </c:if>
		                    </td>
                  		</tr>
                    </table>
                    </form>
                    
                    </td>
                  </tr>
              </table>
              </td>
            </tr>
          </table>
          
          
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="left" valign="top" class="tb_9 border_3">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="left"><img src="<%=path %>/images/icon_14.gif" width="62" height="17" /></td>
                </tr>
                <tr>
                  <td height="30" align="left" valign="bottom"><span class="f_4"><img src="<%=path %>/images/icon_13.gif" width="16" height="14" /></span> 表示当前年度或学期&nbsp;&nbsp;&nbsp;<img src="<%=path %>/images/icon_5.gif" width="15" height="16" /> 表示修改当前年度或学期&nbsp;&nbsp; <img src="<%=path %>/images/icon_11.gif" width="12" height="12" /> 表示删除当前年度或学期 &nbsp;&nbsp;<img src="<%=path %>/images/icon_12.gif" width="18" height="18" align="absmiddle" /> 表示添加年度或学期</td>
                </tr>
              </table>
              </td>
            </tr>
          </table>
          
          </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
  </body>
</html>
